﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using FrameWork;
using FrameWork.Components;
using FrameWork.WebControls;

namespace FrameWork.web.Module.ITMS.FrontPage
{
    public partial class PersonInfo : System.Web.UI.Page
    {
        public string U_PhotoUrl_Js = "";
        public string MaxImgUrl = "";
        

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                OnStart();
            }
        }

        private void OnStart()
        {
            int UserID = (int)Common.Get_UserID;
            sys_UserTable ut = BusinessFacade.sys_UserDisp(UserID);
            OnStartData(ut);
        }

        private void OnStartData(sys_UserTable ut)
        {
            #region "显示数据"
           // U_LoginName_Value.Text = ut.U_LoginName;
           //U_Password_Value.Text = "******";
           //U_Type_Value.Text = ut.U_Type == 0 ? "超级用户" : "普通用户";
           // U_Status_Value.Text = ut.U_Status == 0 ? "正常" : "禁止";
            U_UserNO_Value.Text = ut.U_UserNO;
            U_CName_Value.Text = ut.U_CName;
            U_EName_Value.Text = ut.U_EName;
            U_GroupID_Value.Text = BusinessFacade.sys_GroupDisp(ut.U_GroupID).G_CName;
            U_Sex_Value.Text = ut.U_Sex == 0 ? "女" : "男";
            U_BirthDay_Value.Text = ut.U_BirthDay.ToString("yyyy/MM/dd");
            U_Title_Value.Text = BusinessFacade.sys_FieldValueDisp(ut.U_Title).V_Text;
            U_IDCard_Value.Text = ut.U_IDCard;
            U_HomeTel_Value.Text = ut.U_HomeTel;
            U_MobileNo_Value.Text = ut.U_MobileNo;
            U_CompanyMail_Value.Text = ut.U_CompanyMail;
            U_Email_Value.Text = ut.U_Email;
            U_Extension_Value.Text = ut.U_Extension;
            U_WorkStartDate_Value.Text = ut.U_WorkStartDate.ToString("yyyy/MM/dd");
            U_Remark_Value.Text = ut.U_Remark;
            if ((ut.U_PhotoUrl + "").Trim() != "")
            {
                U_PhotoUrl_Value.ImageUrl = Common.BuildDownFileUrl("UserPhoto/s_" + ut.U_PhotoUrl);
                MaxImgUrl = Common.BuildDownFileUrl("UserPhoto/" + ut.U_PhotoUrl);

            }
            else
                U_PhotoUrl_Value.Visible = false;
            U_LastIP_Value.Text = Common.GetIPLookUrl(ut.U_LastIP);
            U_LastDateTime_Value.Text = ut.U_LastDateTime.ToString();
            #endregion
        }
    }
}
